<template>
  <div>
    <h2 style="color: #222; font-size: 20px; font-weight: bold;">订单管理</h2>
    <el-table :data="orders" v-loading="loading">
      <el-table-column prop="id" label="订单号" width="100" />
      <el-table-column prop="userName" label="用户" width="120" />
      <el-table-column prop="photographerName" label="摄影师" width="120" />
      <el-table-column prop="packageName" label="套餐" width="120" />
      <el-table-column prop="totalPrice" label="金额" width="100">
        <template #default="{ row }: { row: any }">¥{{ row.totalPrice }}</template>
      </el-table-column>
      <el-table-column prop="shootingTime" label="拍摄时间" width="160" />
      <el-table-column prop="status" label="状态" width="100" />
      <el-table-column prop="createTime" label="创建时间" width="160" />
    </el-table>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import api from '@/utils/api'

const orders = ref<any[]>([])
const loading = ref(false)
const fetchOrders = async () => {
  loading.value = true
  const res = await api.get('/orders/list')
  orders.value = res.data || []
  loading.value = false
}
onMounted(() => {
  fetchOrders()
})
</script> 